package com.neusoft.service.impl;

import com.neusoft.domain.DeliveryAddress;
import com.neusoft.mapper.DeliveryAddressDao;
import com.neusoft.service.DeliveryAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeliveryAddressServiceImpl implements DeliveryAddressService {

    @Autowired
    DeliveryAddressDao deliveryAddressDao;

    @Override
    public List<DeliveryAddress> listDeliveryAddressByUserId(String userId) {
//        deliveryAddressService.listDeliveryAddressByUserId(userId);
        return deliveryAddressDao.listDeliveryAddressByUserId(userId);
    }

    @Override
    public Integer saveDeliveryAddress(DeliveryAddress deliveryAddress) {

        return deliveryAddressDao.saveDeliveryAddress(deliveryAddress);

    }

    @Override
    public Integer removeDeliveryAddress(Integer daId) {

        return deliveryAddressDao.removeDeliveryAddress(daId);

    }

    @Override
    public DeliveryAddress getDeliveryAddressById(Integer daId) {

        return deliveryAddressDao.getDeliveryAddressById(daId);

    }

    @Override
    public Integer updateDeliveryAddress(DeliveryAddress deliveryAddress) {

        return deliveryAddressDao.updateDeliveryAddress(deliveryAddress);

    }
}
